#include<bits/stdc++.h>

using namespace std;

int main() {
    char s[1000];
    for (int i = 0; i < 3; i++) {
        fgets(s, 1000 - 1, stdin);

        int letters = 0;
        int numbers = 0;
        int spaces = 0;
        int others = 0;
        char *p;
        for (p = s; *p; ++p) {
            if (*p == '\n')break;
            else if (isalpha(*p))++letters;
            else if (isdigit(*p))++numbers;
            else if (isspace(*p))++spaces;
            else ++others;

        }
        printf("%d %d %d %d\n", letters, numbers, spaces, others);

    }

    return 0;
}